/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.delivery.service.DeliveryRuleService20111021
   Module Description   :

   Date Created      : 2011/10/21
   Original Author   : feeling.wang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.delivery.service;

import java.util.List;
import java.util.Map;

import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.ec.delivery.entity.DeliveryRule;
import com.yaodian100.ec.delivery.entity.ViewDeliveryRule;
import com.yaodian100.ec.order.entity.Orders;

/**
 * @author feeling.wang
 * 
 */
public interface DeliveryRuleService {
	public DeliveryRule getCartDeliveryRule(String type, String toProvince, String toCity, String toDistrict,
			String service);

	/**
	 * 依购物车编号查询可用的省份
	 * 
	 * @param id
	 * @return
	 */
	public Map<String, String> getCartProvinces(String id);

	/**
	 * 依订单编号查询可用的省份
	 * 
	 * @param id
	 * @return
	 */
	public Map<String, String> getOrderProvinces(String id);

	/**
	 * 依订单编号查询可用的省份
	 * 
	 * @param id
	 * @return
	 */
	public Map<String, String> getServiceOrderProvinces(String id);

	/**
	 * 依购物车编号、省份查询可用的城市
	 * 
	 * @param id
	 * @param toProvince
	 * @return
	 */
	public Map<String, String> getCartCitys(String id, String toProvince);

	/**
	 * 依订单编号、省份查询可用的城市
	 * 
	 * @param id
	 * @param toProvince
	 * @return
	 */
	public Map<String, String> getOrderCitys(String id, String toProvince);

	/**
	 * 依订单编号、省份查询可用的城市
	 * 
	 * @param id
	 * @param toProvince
	 * @return
	 */
	public Map<String, String> getServiceOrderCitys(String id, String toProvince);

	/**
	 * 依订单编号、省份查询可用的城市
	 * 
	 * @param id
	 * @param toProvince
	 * @return
	 */
	public Map<String, String> getMobileCartCitys(String id, String toProvince);

	/**
	 * 依购物车编号、城市查询可用的地区
	 * 
	 * @param id
	 * @param toCity
	 * @return
	 */
	public List<ViewDeliveryRule> getCartDistricts(String id, String toCity);

	/**
	 * 依订单编号、城市查询可用的地区
	 * 
	 * @param id
	 * @param toCity
	 * @return
	 */
	public List<ViewDeliveryRule> getOrderDistricts(String id, String toCity);

	/**
	 * 依订单编号、城市查询可用的地区
	 * 
	 * @param id
	 * @param toCity
	 * @return
	 */
	public List<ViewDeliveryRule> getServiceOrderDistricts(String id, String toCity);

	public Map<String, String> findDeliveryType(String type, String id);

	/**
	 * 判断订单是的支付方式是否可改为货到付款
	 * 
	 * @param id 订单编号
	 * @return
	 */
	public ViewDeliveryRule canUseCodByOrderId(String id);

	// public List<ViewDeliveryRule> getViewDeliveryRuleList(CommonCriteria crit);

	// public List<ViewDeliveryRule> getViewDeliveryRuleList(String deliveryType, String fromProvince, String fromCity,
	// String fromDistrict, String toProvince, String toCity, String toDistrict);

	public List<ViewDeliveryRule> getViewDeliveryRuleList(Map<String, String> deliveryTypeMap, String toProvince,
			String toCity, String toDistrict);

	public String findAddressVersion();

	public String findAddressVersion(Orders order);

	/**
	 * 依购物车/訂單 商品判断是否允许cod付款
	 * 
	 * @param cartId
	 * @throws CoreException
	 */
	public boolean chkProdDetailCanUseCod(String type, String id) throws CoreException;

	/**
	 * @param type
	 * @param id
	 * @return
	 * @throws CoreException
	 */
	public Map<String, String> cartDetailCanUseCodMap(String id) throws CoreException;

	public Map<String, String> orderDetailCanUseCodMap(String id) throws CoreException;

	public String logisticProviderTp(Map<String, String> prodCanUseCodMap) throws CoreException;

	public String logisticProviderTpByOrderId(String id) throws CoreException;

	/**
	 * 查询大材积支援的省份
	 * 
	 * @return
	 * @throws CoreException
	 */
	public Object[] findOtherDeliveryRuleProvinces() throws CoreException;

	/**
	 * 依省份查询大材积支援的城市
	 * 
	 * @param province
	 * @return
	 * @throws CoreException
	 */
	public Object[] findOtherDeliveryRuleCitysByProvince(String province) throws CoreException;

	/**
	 * 依城市查询大材积支援的地区
	 * 
	 * @param city
	 * @return
	 * @throws CoreException
	 */
	public Object[] findOtherDeliveryRuleDistrictsByCity(String city) throws CoreException;

	/**
	 * 依商品编号查询可用的省份
	 * 
	 * @param id
	 * @return
	 */
	public Map<String, String> getProductProvinces(String id);

	/**
	 * 依商品编号、省份查询可用的城市
	 * 
	 * @param id
	 * @param toProvince
	 * @return
	 */
	public Map<String, String> getProductCitys(String id, String toProvince);

	/**
	 * 依商品编号、城市查询可用的地区
	 * 
	 * @param id
	 * @param toCity
	 * @return
	 */
	public List<ViewDeliveryRule> getProductDistricts(String id, String toCity);

	public DeliveryRule getProductDeliveryRule(String id, String toProvince, String toCity, String toDistrict,
			String service);
}
